
package com.probiz.estore.common.model.system.base;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.core.model.BaseObject;

/**
 * MailQueue Base Java Bean, base class for the model, mapped directly to
 * database table
 * 
 * Avoid changing this file if not necessary, will be overwritten.
 * 
 */
public class MailQueueTbl extends BaseObject implements Serializable {

	private static final long	serialVersionUID	= -5052385776218073712L;
	protected java.util.Date	createTime;
	protected String			errorMsg;
	protected String			mailFrom;
	protected Integer			mailQueueId;
	protected String			mailSubject;
	protected String			mailTos;
	protected byte[]			mimeMessage;
	protected java.util.Date	nextRetryTime;
	protected Short				sendStatus;
	protected Short				sendTimes;
	protected java.util.Date	updateTime;

	/**
	 * Default Empty Constructor for class MailQueue
	 */
	public MailQueueTbl() {
		super();
	}

	/**
	 * Default Key Fields Constructor for class MailQueue
	 */
	public MailQueueTbl(Integer in_mailQueueId) {
		this.setMailQueueId(in_mailQueueId);
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	@Override
	public boolean equals(Object object) {
		if (!(object instanceof MailQueueTbl)) {
			return false;
		}
		MailQueueTbl rhs = (MailQueueTbl) object;
		return new EqualsBuilder().append(this.mailQueueId, rhs.mailQueueId)
				.append(this.mailSubject, rhs.mailSubject).append(
						this.mailFrom, rhs.mailFrom).append(this.mailTos,
						rhs.mailTos).append(this.sendStatus, rhs.sendStatus)
				.append(this.sendTimes, rhs.sendTimes).append(this.errorMsg,
						rhs.errorMsg).append(this.mimeMessage, rhs.mimeMessage)
				.append(this.createTime, rhs.createTime).append(
						this.updateTime, rhs.updateTime).isEquals();
	}

	/**
	 * *
	 * 
	 * @return java.util.Date
	 * @hibernate.property column="createTime" type="java.util.Date" length="0"
	 *                     not-null="true" unique="false"
	 */
	public java.util.Date getCreateTime() {
		return this.createTime;
	}

	/**
	 * *
	 * 
	 * @return String
	 * @hibernate.property column="errorMsg" type="java.lang.String"
	 *                     length="1024" not-null="true" unique="false"
	 */
	public String getErrorMsg() {
		return this.errorMsg;
	}

	/**
	 * Return the name of the first key column
	 */
	@Override
	public String getFirstKeyColumnName() {
		return "mailQueueId";
	}

	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	@Override
	public Integer getId() {
		return mailQueueId;
	}

	/**
	 * *
	 * 
	 * @return String
	 * @hibernate.property column="mailFrom" type="java.lang.String"
	 *                     length="128" not-null="true" unique="false"
	 */
	public String getMailFrom() {
		return this.mailFrom;
	}

	/**
	 * *
	 * 
	 * @return Integer
	 * @hibernate.id column="mailQueueId" type="java.lang.Integer"
	 *               generator-class="native"
	 */
	public Integer getMailQueueId() {
		return this.mailQueueId;
	}

	/**
	 * *
	 * 
	 * @return String
	 * @hibernate.property column="mailSubject" type="java.lang.String"
	 *                     length="256" not-null="true" unique="false"
	 */
	public String getMailSubject() {
		return this.mailSubject;
	}

	/**
	 * *
	 * 
	 * @return String
	 * @hibernate.property column="mailTos" type="java.lang.String"
	 *                     length="1024" not-null="true" unique="false"
	 */
	public String getMailTos() {
		return this.mailTos;
	}

	/**
	 * *
	 * 
	 * @return byte[]
	 * @hibernate.property column="mimeMessage" type="java.lang.String"
	 *                     length="65535" not-null="true" unique="false"
	 */
	public byte[] getMimeMessage() {
		return this.mimeMessage;
	}

	public java.util.Date getNextRetryTime() {
		return nextRetryTime;
	}

	/**
	 * *
	 * 
	 * @return Short
	 * @hibernate.property column="sendStatus" type="java.lang.Short" length="5"
	 *                     not-null="true" unique="false"
	 */
	public Short getSendStatus() {
		return this.sendStatus;
	}

	/**
	 * *
	 * 
	 * @return Short
	 * @hibernate.property column="sendTimes" type="java.lang.Short" length="5"
	 *                     not-null="true" unique="false"
	 */
	public Short getSendTimes() {
		return this.sendTimes;
	}

	/**
	 * *
	 * 
	 * @return java.util.Date
	 * @hibernate.property column="updateTime" type="java.util.Date" length="0"
	 *                     not-null="true" unique="false"
	 */
	public java.util.Date getUpdateTime() {
		return this.updateTime;
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973).append(
				this.mailQueueId).append(this.mailSubject)
				.append(this.mailFrom).append(this.mailTos).append(
						this.sendStatus).append(this.sendTimes).append(
						this.errorMsg).append(this.mimeMessage).append(
						this.createTime).append(this.updateTime).toHashCode();
	}

	/**
	 * Set the createTime
	 * 
	 * @spring.validator type="required"
	 */
	@Override
	public void setCreateTime(java.util.Date aValue) {
		this.createTime = aValue;
	}

	/**
	 * Set the errorMsg
	 * 
	 * @spring.validator type="required"
	 */
	public void setErrorMsg(String aValue) {
		this.errorMsg = aValue;
	}

	/**
	 * Set the mailFrom
	 * 
	 * @spring.validator type="required"
	 */
	public void setMailFrom(String aValue) {
		this.mailFrom = aValue;
	}

	/**
	 * Set the mailQueueId
	 */
	public void setMailQueueId(Integer aValue) {
		this.mailQueueId = aValue;
	}

	/**
	 * Set the mailSubject
	 * 
	 * @spring.validator type="required"
	 */
	public void setMailSubject(String aValue) {
		this.mailSubject = aValue;
	}

	/**
	 * Set the mailTos
	 * 
	 * @spring.validator type="required"
	 */
	public void setMailTos(String aValue) {
		this.mailTos = aValue;
	}

	/**
	 * Set the mimeMessage
	 * 
	 * @spring.validator type="required"
	 */
	public void setMimeMessage(byte[] aValue) {
		this.mimeMessage = aValue;
	}

	public void setNextRetryTime(java.util.Date nextRetryTime) {
		this.nextRetryTime = nextRetryTime;
	}

	/**
	 * Set the sendStatus
	 * 
	 * @spring.validator type="required"
	 */
	public void setSendStatus(Short aValue) {
		this.sendStatus = aValue;
	}

	/**
	 * Set the sendTimes
	 * 
	 * @spring.validator type="required"
	 */
	public void setSendTimes(Short aValue) {
		this.sendTimes = aValue;
	}

	/**
	 * Set the updateTime
	 * 
	 * @spring.validator type="required"
	 */
	@Override
	public void setUpdateTime(java.util.Date aValue) {
		this.updateTime = aValue;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return new ToStringBuilder(this)
				.append("mailQueueId", this.mailQueueId).append("mailSubject",
						this.mailSubject).append("mailFrom", this.mailFrom)
				.append("mailTos", this.mailTos).append("sendStatus",
						this.sendStatus).append("sendTimes", this.sendTimes)
				.append("errorMsg", this.errorMsg).append("mimeMessage",
						this.mimeMessage).append("createTime", this.createTime)
				.append("updateTime", this.updateTime).toString();
	}

}